<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>


<c:if test="${code==1}">
	<form id="pagerForm" method="post" action="companyUserAction.action?toResult=searchCompanyUser&rightId=${rightId}">
		<input type="hidden" name="pageNum" value="${page.currentPage }" /> 
		<input type="hidden" name="pageSize" value="${page.pageSize }" />
	</form>

	<form onsubmit="return navTabSearch(this);" action="companyUserAction.action?toResult=searchCompanyUser&rightId=${rightId}" method="post">
		<div class="pageHeader">
			<input type="hidden" name="init" value=0>
			<div class="searchBar">
				<table class="searchContent">
					<tr>
						<td>负责人电话: <input type="text" name="bossMobile" value="${bossMobile}" />
						</td>
						<td>公司名称: <input type="text" name="companyname" value="${companyname}" />
						</td>
						<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
						<td>
							<div class="buttonActive">
								<div class="buttonContent">
									<button type="submit">检索</button>
								</div>
							</div>
						</td>
					</tr>
				</table>
			</div>
		</div>
		<div class="pageContent">
			<div class="panelBar">
				<ul class="toolBar">
					<c:forEach items="${righSubtList}" var="rightsub">
						<!-- 添加  -->
						<c:if test="${fn:contains(rightsub.rightValue,'addCompanyUser')}">
							<li><a class="add" href="${rightsub.rightValue}&rightId=${rightId}" target="navTab"><span>${rightsub.rightName}</span> </a>
							</li>
							<li class="line">line</li>
						</c:if>
						<!-- 修改  -->
						<c:if test="${fn:contains(rightsub.rightValue,'updateCompanyUser')}">
							<li><a class="edit" href="${rightsub.rightValue}&supportID={sid_support}&rightId=${rightId}" target="navTab"><span>${rightsub.rightName}</span> </a>
							</li>
							<li class="line">line</li>
						</c:if>
						<!-- 删除 -->
						<c:if test="${fn:contains(rightsub.rightValue,'deleteCompanyUser')}">
							<li><a class="delete" href="${rightsub.rightValue}&supportID={sid_support}&rightId=${rightId}" target="ajaxTodo" title="确认要删除吗？"><span>${rightsub.rightName}</span> </a>
							</li>
							<li class="line">line</li>
						</c:if>
						
						<!-- 订单 -->
						<c:if test="${fn:contains(rightsub.rightValue,'companyUserOrders')}">
						<li><a class="edit" href="${rightsub.rightValue}&companyUserId={sid_support}&rightId=${rightId}" target="dialog"  rel="dlg_page_order" title="用户订单信息" width="1000" height="600"><span>${rightsub.rightName}</span> </a>
							<li class="line">line</li>
						</c:if>
					</c:forEach>
				</ul>
			</div>
			<table class="list" width="100%" layoutH="138">
				<thead>
					<tr>
						<th align="center">序号</th>
						<th align="center">公司代号</th>
						<th align="center">公司名称</th>
						<th align="center">公司电话</th>
						<th align="center">公司地址</th>
						<th align="center">负责人名称</th>
						<th align="center">负责人电话</th>						
						<th align="center">负责人邮件</th> 
						<th align="center">余额</th>
						<th align="center">图片1</th>
						<th align="center">图片2</th>
						<th align="center">图片3</th>
						<th align="center">是否锁住</th>
					</tr>
				</thead>
				<tbody>
					<s:iterator var="companyUser" value="page.data" status="st">
						<tr  target="sid_support" rel="<s:property value="#companyUser.id" />">
							<th width="2%" align="center"><s:property value="page.pageSize * (page.currentPage-1) + #st.index + 1" />
							</th>
							<th width="5%" align="left"><s:property value="#companyUser.companyCode" />
							</th>
							<th width="5%" align="left"><s:property value="#companyUser.companyName" />
							</th>
							<th width="5%" align="left"><s:property value="#companyUser.companyTel" />
							</th>
							
							<th width="12%" align="left"><s:property value="#companyUser.provinceName" />
														<s:property value="#companyUser.cityName" />
														<s:property value="#companyUser.districtName" />
														<s:property value="#companyUser.address" />
							</th>
							<th width="5%" align="left"><s:property value="#companyUser.companyBoss" />
							</th>
							<th width="5%" align="left"><s:property value="#companyUser.bossMobile" />
							</th>
							<th width="5%" align="left"><s:property value="#companyUser.bossEmail" />
							</th>
							<th width="5%" align="left" ><s:property value="#companyUser.company_Balance" />
							</th>
<%-- 							<th width="5%" align="left"><s:property value="#companyUser.photoUrl1" />
							</th>
							<th width="5%" align="left"><s:property value="#companyUser.photoUrl2" />
							</th>
							<th width="5%" align="left"><s:property value="#companyUser.photoUrl3" />
							</th> --%>
							<th width="5%" align="center"><a href="categoryPic_companyUser?imgPath=<s:property value="#companyUser.photoUrl1" />" target="dialog" width="625" height="400" mask=true><span>预览</span> </a></th>
							<th width="5%" align="center"><a href="categoryPic_companyUser?imgPath=<s:property value="#companyUser.photoUrl2" />" target="dialog" width="625" height="400" mask=true><span>预览</span> </a></th>
							<th width="5%" align="center"><a href="categoryPic_companyUser?imgPath=<s:property value="#companyUser.photoUrl3" />" target="dialog" width="625" height="400" mask=true><span>预览</span> </a></th>
							<th width="5%" align="left">
								<s:if test="#companyUser.locked ==0"><span style="color:gray">禁用</span></s:if> 
								<s:elseif test="#companyUser.locked ==1"><span style="color:blue">可用</span></s:elseif>
							</th>						
					</tr>
					</s:iterator>
				</tbody>
			</table>
			<div class="panelBar">
				<div class="pages">
					<span>共${page.totalNum }条，共${page.totalPage }页</span>
				</div>
				<div class="pagination" targetType="navTab" totalCount="${page.totalNum }" numPerPage="${page.pageSize }" pageNumShown="10" currentPage="${page.currentPage }"></div>
			</div>
		</div>
	</form>
</c:if>
<c:if test="${code==0}">
	${message}
</c:if>